import http from '../../../http/http'
import * as url from '../../../api/cfApi'
import {Message} from 'element-ui';
const state = {
  vipRegister: {
  
  },
  vipRecharge: {
  
  }
}
const mutations ={

}
const actions ={
  getTopDishes({commit}) {
    let rank = {}
    return http({
      url: '/lxp'+url.HOME_STATIC_DISH,
      method: 'post'
    }).then(res => {
      if (res.data.code === '200') {
        rank.dishesTop3 = res.data.data
        return http({
          url: '/lxp'+url.HOME_STATIC_SEAT,
          method: 'post'
        })
      }
    }).then(res => {
      console.log('fanzhuo ',res)
      if (res.data.code === '200') {
        
        rank.timePeriod = res.data.data
        return http({
          url: '/lxp'+url.HOME_STATIC_DRINK,
          method: 'post'
        })
      }
    }).then(res=>{
      if (res.data.code === '200') {
        rank.drinkTop3 = res.data.data
        return rank
      }
    }).catch(err => {
      console.log(err)
    })
  }
}
const getters ={

}
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
